import { IsNotEmpty, IsString, IsNumber, Length } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
export class CreateLoginDto {
  @IsNotEmpty()
  @IsString()
  @Length(3, 20, {
    message: '不能超过20个字符',
  })
  @ApiProperty({ description: '用户名', enumName: 'xiaoliu' })
  name: string;

  @IsNumber()
  @ApiProperty({ description: '年龄', example: 18 })
  age: number;
}
